#pragma strict

var cam:Camera;

private var lastWidth:float;
private var lastHeight:float;

function Start(){
	lastWidth = Screen.width;
	lastHeight = Screen.height;
}

function Update () {
	CheckResolution();
}

function CheckResolution(){
	var curWidth:float = Screen.width;
	var curHeight:float = Screen.height;
	
	if(curWidth != lastWidth || curHeight != lastHeight){
		var widthFactor:float = curWidth / lastWidth;
		var heightFactor:float = curHeight / lastHeight;
		transform.localScale = Vector3(widthFactor,heightFactor,1);
		Debug.Log(curWidth+":"+lastWidth+">"+widthFactor);
	}
}